import {createApp} from 'vue'
import router from './router'
import store from './store'
import App from './App.vue'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import locale from 'element-plus/lib/locale/lang/zh-cn'
import lazyUseComponent from './core/lazyUse'
import hasPermi from './core/hasPerm'
import directive from './core/directive'
import modal from './core/modal'
import 'element-plus/dist/index.css'
import './assets/css/style.css'


const app = createApp(App)

app.config.globalProperties.$modal = modal
app.config.globalProperties.$store = store

app.use(lazyUseComponent, app)
app.use(hasPermi)
app.use(directive)
app.use(router).use(store)
app.use(ElementPlus, {locale})
app.mount('#app')
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
